#ifndef PRODUCTIONRULE_H_
#define PRODUCTIONRULE_H_

#include <iostream>
#include <ostream>
#include <set>
#include <string>

using namespace std;

namespace regulargrammatica {

template <class DataType>
class ProductionRule
{
public:
	ProductionRule();
	ProductionRule(DataType lNonTerminal, char rTerminal, DataType rNonTerminal);
	ProductionRule(DataType lNonTerminal, char rTerminal);
	ProductionRule(const ProductionRule<DataType> &productionRule);
	~ProductionRule();

	DataType getLeftNonTerminal();
	DataType getRightNonTerminal();
	char getRightTerminal();
	bool getIfEnd();

	bool operator< (const ProductionRule<DataType> &right) const;
	bool operator== (const ProductionRule<DataType> &right) const;

	friend ostream& operator <<(ostream &os, const ProductionRule<DataType> &rule)
	{
		os << rule.leftNonTerminal << " => ";
		if(rule.rightTerminal == EPS)
		{
			os << "testEps";
		} 
		else 
		{
			os << rule.rightTerminal;
		}
		os << rule. rightNonTerminal;
		return os;
	}
private:
	DataType leftNonTerminal;
	DataType rightNonTerminal;
	char rightTerminal;
	bool nonTerminal;
};
#include "ProductionRule.cpp"
}
#endif
